
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <asm/ioctl.h>
#include <sys/mman.h>
#include <linux/fb.h>




static int g_iFdTextFile;

int main()
{	

unsigned char i=0;
	unsigned char Buffer[100]={
	0x00,0x00,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x99};

	g_iFdTextFile = open("thermostat.dat", O_RDONLY);
	if (0 > g_iFdTextFile)
	{
		printf("can't open text file %s\n");
		return -1;
	}

	if(read(g_iFdTextFile,Buffer,100) <= 0){printf("Cannot Read the Image File!\n");exit(0);}
       
	for(i=0;i<100;i+=10){  
	printf("0x%02X ",Buffer[i+0]);
	printf("0x%02X ",Buffer[i+1]);
	printf("0x%02X ",Buffer[i+2]);
	printf("0x%02X ",Buffer[i+3]);
	printf("0x%02X ",Buffer[i+4]);
	printf("0x%02X ",Buffer[i+5]);
	printf("0x%02X ",Buffer[i+6]);
	printf("0x%02X ",Buffer[i+7]);
	printf("0x%02X ",Buffer[i+8]);
	printf("0x%02X \n",Buffer[i+9]);
	printf("app end! \n");
	}



	close(g_iFdTextFile);
	printf(" app end !\n");

	return 0;
}


